﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DIT.Domain;
using System.Data.Common;
using System.Data;

namespace DIT.DB.DAL
{
    static class DataMapper
    {
        private static IEnumerable<T> Map<T>(DataTable table)
        {
            T[] entityList = new T[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (typeof(T) == typeof(Account))
                    entityList[i] = (T)(DBExtension.MapAccount(table.Rows[i]));
                else if (typeof(T) == typeof(FilingStatus))
                    entityList[i] = (T)(DBExtension.MapFilingStatus(table.Rows[i]));
                else
                    throw new ArgumentException("Invalid Type");
            }
            return entityList;
        }

        internal static T Map<T>(IDataRecord iDataRecord)
        {
            throw new NotImplementedException();
        }


        internal static IDbCommand InsertCommand<T>()
        {
            throw new NotImplementedException();
        }

        internal static IDbCommand DeleteCommand<T>()
        {
            throw new NotImplementedException();
        }

        internal static IDbCommand ModifyCommand<T>()
        {
            throw new NotImplementedException();
        }

        internal static IDbCommand SelectAllCommand<T>()
        {
            throw new NotImplementedException();
        }

        internal static IDbCommand SelectByIDCommand<T>()
        {
            throw new NotImplementedException();
        }
    }
}
